/*
 - !!! SOME NOT FOUND DISPLAY    -
 - Need Set Drupal colors system -
 - Add By wenroo.                -
 - 2018.04.26                    -
 - @todo                         -
*/

@import './views.less';
@import './ccms.less';

/*
  Move Fun
*/
.transition {
  -webkit-transition: all .25s ease-out;
  -o-transition: all .25s ease-out;
  transition: all .25s ease-out;
}


// Reset Style
a {
  color: @link-color;
  text-decoration: none;

  &:hover,
  &:focus {
    color: @link-hover-color;
    text-decoration: @link-hover-decoration;
  }

  &:focus {
    .tab-focus();
  }
}

.img-responsive {
  .img-responsive();
}

.img-rounded {
  border-radius: @border-radius-large;
}

.img-thumbnail {
  padding: @thumbnail-padding;
  line-height: @line-height-base;
  background-color: @thumbnail-bg;
  border: 1px solid @thumbnail-border;
  border-radius: @thumbnail-border-radius;
  .transition(all .2s ease-in-out);

  // Keep them at most 100% wide
  .img-responsive(inline-block);
}


hr {
  margin-top:    @line-height-computed;
  margin-bottom: @line-height-computed;
  border: 0;
  border-top: 1px solid @hr-border;
}


// Only display content to screen readers
//
// See: http://a11yproject.com/posts/how-to-hide-content

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0,0,0,0);
  border: 0;
}

// Use in conjunction with .sr-only to only display content when it's focused.
// Useful for "Skip to main content" links; see http://www.w3.org/TR/2013/NOTE-WCAG20-TECHS-20130905/G1
// Credit: HTML5 Boilerplate

.sr-only-focusable {
  &:active,
  &:focus {
    position: static;
    width: auto;
    height: auto;
    margin: 0;
    overflow: visible;
    clip: auto;
  }
}


// iOS "clickable elements" fix for role="button"
//
// Fixes "clickability" issue (and more generally, the firing of events such as focus as well)
// for traditionally non-focusable elements with role="button"
// see https://developer.mozilla.org/en-US/docs/Web/Events/click#Safari_Mobile

[role="button"] {
  cursor: pointer;
}

// Move From scaffolding.css
.error {
  color: @brand-danger;
}

.img-circle {
  border-radius: 50%;
}


/* list-panel on phone for activities*/
@media(max-width:768px) {
  div[class*=useractivities] {
    ul {
      li {
        display: -webkit-box;
        display: -ms-flexbox;
        display: flex;
        -webkit-box-align: center;
        -ms-flex-align: center;
        align-items: center;

        > span:first-child {
          width: 63%;
        }

        > span.pull-right {
          min-width: 70px;
        }

        > a {
          -webkit-box-ordinal-group: 3;
          -ms-flex-order: 2;
          order: 2;
        }
      }
    }
  }
}
.expand{
  -webkit-transition: all .4s ease-out;
  transition: all .4s ease-out;
}

// sidebar menu
[region=sidebar_first]{
  li{
    .iconfont{
      position: absolute;
      right: 14px;
      top: 5px;
      padding: 8px 16px;
      font-size: 16px;

      -webkit-transform: rotate(0deg);
              transform: rotate(0deg);
      -webkit-transition: all .2s linear;
      transition: all .2s linear;
      &:hover{
        cursor: pointer;
      }
    }
    &.is-open{
      .iconfont{
        -webkit-transform: rotate(180deg);
                transform: rotate(180deg);
      }
    }
    > ul.nav{
      opacity: 0;
      min-height: 0;
      height: 0;
      visibility: hidden;
      &.expand{
        margin-left: 0;
        opacity: 1;
        height: 100%;
        visibility: visible;
        >li{
          >a{
            padding-left: 35px;
          }
        }
      }
    }
  }
}

/*
  - Sidebar Toggle
  - Hide for mobile, show later
*/
.toggle-button {
  z-index: 100;
  cursor: pointer;
}

/*  navbar  */
.navbar {
  z-index: 500;
  border-bottom: none;
  *{
    box-sizing: border-box;
    &:before,
    &:after{
      -webkit-box-sizing: border-box;
      -moz-box-sizing: border-box;
      box-sizing: border-box;
    }
  }
}
@media (min-width: 768px) {
  #navbar .navbar-nav {
    float: right;
    font-size: 16px;
  }
}


.navbar-inverse-after{  /* @class */
  content: '';
  opacity: 0;
  width: 0;
  position: absolute;
  margin: auto;
  display: block;
  right: -15%;
  bottom: 3px;
  left: -15%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(to right, rgba(255, 255, 255, 0) 0, #fff 50%, rgba(255, 255, 255, 0) 100%);
  transition: width .6s, opacity .6s;
  width: 100%;
  opacity: 1;
}

.navbar-inverse{
  .navbar-nav{
    >li{
      &:hover{
        a{
          &:after{
            // .navbar-inverse-after;
          }
        }
      }
      &.active{
        >a{
          &:after{
            // .navbar-inverse-after;
          }
        }
      }
    }
  }
}

.sidebar{
  position: fixed;
  top: 52px;
  bottom: 0;
  left: 0;
  z-index: 499;
  display: block;
  padding: 0 15px;
  .nav{
    margin-left: 0;
    .nav{
      margin-left: 1em;
      >li{
        >a{
          padding: 10px 20px;
        }
      }
    }
  }
  .sidebar-guide {
    padding: 20px 15px 10px 15px;
    font-size: 1.2em;
    a {
      color: #fff;
      &:hover {
        text-decoration: none;
        color: #999;
      }
    }
    .description {
      border-top: #999 1px solid;
      font-size: 0.75em;
      color: #999;
      margin-top: 5px;
    }
  }
  .toggle-button-group {
    top: 40%;
    position: absolute;
    right: 0px;
    z-index: 100;
  }
  .toggle-button {
    width: 20px;
    height: 69px;
    background-repeat: no-repeat;
    &:hover {
      width: 26px;
    }
  }
  .toggle-button-r {
    display: none;
  }
  .block-ccms-copyright {
    color: #ddd;
  }
  .block-hit-copyright {
    text-align: center;
    padding: 10px 0;
    position: absolute;
    bottom: 0;
    right: 0;
    color: #999;
    width: 100%;
  }
  @media screen and (max-width: 767px) {
    width: 300px;
    box-sizing: border-box;
  }
}

.sidebar-hide{
  .toggle-button{
    display: none;
  }
  .toggle-button-r {
    top: 40%;
    position: absolute;
    right: -20px;
    display: block;
    background-position: left;
    background-repeat: no-repeat;
    width: 22px;
    height: 62px;
    z-index: 1000;
    &:hover {
      right: -22px;
    }
  }
  @media screen and (max-width: 767px) {
    left: -300px;
  }
  @media screen and (min-width: 768px) {
    left: -25%;
  }
  @media screen and (min-width: 992px) {
    left: -16.66666667%;
  }
}


/*
  Editor actions center
  通过后端判断内容类型添加内容
*/

.editor-actions-center{
  .layout-region-node-footer {
    position: relative;
    .form-actions {
      background-color: rgba(247, 247, 247, 0.62);
      margin-top: 0;
      margin-bottom: 0;
      padding: 1em;
      width: 100%;
      display: table;
      text-align: center;
      box-sizing: border-box;
      >*{
        margin: auto 14px;
        display: inline-block;
        vertical-align: middle;
        float: none;
      }
      @media only screen and (max-width: 767px){
        > .button,
        #edit-cancel{
          margin: 6px 0;
        }
      }
    }
    @media (min-width:768px) {
      position: fixed;
      bottom: 0;
    }
  }
  .node-form .field--name-title>.form-item {
    margin-top: 0;
  }
}


/*
  Form
*/
form{
  input[id*="-remove-button"]{
    .btn--danger;
  }
  .form-search{
    min-height: 27px;
  }
  .form-select{
    min-height: 27px;
  }
}


.form-wrapper-disabled{ /* @class */
  cursor: not-allowed;
  background: #eee;
  color: #737373;
  opacity: 1;
}

.form-checkboxes,
.form-radios{
  .form-item {
    display: inline-block;
    margin-right: 5px;
  }
}

.form-item{
  .description{
    ul{
      padding: 0;
    }
  }
}

.form-control{
  &[disabled],
  &[readonly]{
    .form-wrapper-disabled;
  }
}

fieldset{
  &[disabled]{
    .form-control{
      .form-wrapper-disabled;
    }
  }
}

.layout-node-form{
  .layout-region-node-main{
    .messages {
      display: block;
    }
  }
}

#edit-deploy-quick-settings ul {
  padding: 0;
}


// admin form
.locale-translate-filter-form{
  margin-bottom: 1.5em;
  .details-wrapper{
    padding-bottom: 1em;
  }
}



/*
  - Table
*/
table{
  &.sticky-header {
    top: 50px !important;
  }
  &.footable{
    tr{
      &.footable-empty-tr{
        td{
          display: inherit !important;
          &.views-empty{
            display: table-cell !important;
          }
        }
      }
      th{
        &.footable-first-visible{
          padding: 10px 0 10px 5px;
        }
      }
      td{
        &.footable-icon {
          padding: 10px 0 10px 5px;
        }
      }
    }
  }
  tbody{
    tr{
      td{
        span{
          .footable-toggle {
            font-size: 1.2em;
          }
        }
      }
    }
  }
}



/*
  - Blocks
*/
.block {
  position: relative;
}

.block-heading  {
  margin: 0;
  font-size:18px;
  line-height: 18px;
  padding: 0.5em 1em;
  background-color: #f5f5f2;
  border: 1px solid #bfbfba;
}

.block-content-quick-entry a {
  margin: 10px;
}

.block-deploy-glance {
  border: 1px solid #bfbfba;
  &:before{
    content: "";
    background-color: #f5f5f2;
    border-bottom: 1px solid #bfbfba;
    width: 100%;
    height: 60px;
    position: absolute;
  }
  h2{
    height: 40px;
    line-height: 40px;
  }
  .content {
    padding: 10px 0 30px;
  }
}

.block-dashboard-userinfo{
  .media-left {
    padding-right: 2em;
  }
  .caption {
    width: 70px;
    text-align: center;
  }
}


.block-dashboard-userinfo{
  .media-body{
    ul{
      padding: 0;
      margin: 0;
      li{
        label{
          padding-right: 5px;
          font-weight: normal;
          min-width: 80px;
          display: table-cell;
        }
        span{
          display: table-cell;
        }
      }
    }
  }
}


.block-hit-copyright {
  padding: 0;
  color: #666;
  font-size: 0.9em;
}

.main{
  .block-hit-copyright {
    margin-top: 30px;
    padding-top: 20px;
    border-top: 1px solid #999;
    text-align: center;
  }
}

#navbar #block-ccmsmanage-mobile {
  display: none;
}
@media (max-width:767px){
  #navbar #block-ccmsmanage-mobile {
    display: block;
  }
  #navbar #block-ccmsmanage-main {
    display: none;
  }
}



/* ==========================
  --- Plugins & Customs ---
========================== */

/*
  status
*/

span.status-complete,
a.status-complete {
  color: #006E0A;
}

span.status-pending,
a.status-pending{
  color: #B4975A;
}

span.status-failed,
span.status-rejected,
a.status-failed,
a.status-rejected {
  color: #D60000;
}

span.status-disabled,
a.status-disabled{
  color: #999;
}

/*
  dropbutton widget
*/
.class-dropbutton-single{  /* @class */
  .dropbutton-widget {
    border: 1px solid #a6a6a6;
    border-radius: 20em;

    input {
      &:active,
      &:hover {
        border-radius: 20em;
      }
    }

    .dropbutton {
      border-radius: 20em;
    }
  }
}

.js td .dropbutton-multiple {
  padding-right: 5em;
}

.form-actions.js-form-wrapper{
  .dropbutton-single {
    .class-dropbutton-single;
  }
}

/*
  Json editor
*/
.jsoneditor-mode-tree{
  table{
    margin: 0;
    padding: 0;
    tr{
      border: none;
    }
  }
}


/*
  Mail
*/
.actions-mail {
  text-align: center;
  a{
    margin-left: 40px;
  }
}

.mail-footer {
  border-bottom: 1px solid grey;
  height: 30px;
  position: relative;
  img {
    position: absolute;
    right: 0;
  }
  ul{
    &.menu{
      list-style-type: none;
      list-style-type: none;
      padding-left: 0;
      li{
        &.menu-item{
          list-style-image: none;
          list-style-type: none;
          display: inline;
          padding: 0 5px 0;
          border-right: 1px solid grey;
          &:last-child{
            border-right: none;
          }
          a{
            color: grey;
          }
        }
      }
    }
  }
}

/*
  Media
*/
.media{
  .media-heading{
    h5&{
      line-height: 20px;
    }
    &:not(:first-child) {
     margin-top: 15px;
    }
  }
  .media-body{
    ul {
      list-style: none;
    }
    .comment {
      border-bottom: 1px solid #E7EAEB;
      padding-bottom: 15px;
    }
  }
}

/*
  Pace
*/
.pace{
  .pace-progress {
    background: #fff;
  }
  .pace-progress-inner {
    box-shadow: 0 0 10px #fff, 0 0 5px #fff;
  }
  .pace-activity {
    border-top-color: #fff;
    border-left-color: #fff;
  }
}

/*
  Toolbar tab tour
*/
#toolbar-tab-tour{
  float: right;
  position: relative;
  a{
    font-weight: normal;
    font-size: 16px;
    color: #fff;
    padding: 15px;
    display: block;
    position: relative;
    &:hover,
    &focus{
      text-decoration: none;
    }
  }
  &:hover{
    &:before{
      content: '';
      position: absolute;
      margin: auto;
      display: block;
      right: -15%;
      bottom: 3px;
      left: -15%;
      height: 2px;
      border-radius: 2px;
      background: linear-gradient(to right, rgba(255, 255, 255, 0) 0, #fff 50%, rgba(255, 255, 255, 0) 100%);
      transition: width .6s, opacity .6s;
      width: 100%;
      opacity: 1;
    }
  }
}


/*
  slimScrollDiv
*/
.slimScrollDiv {
  padding-bottom: 40px;
  margin-left: -15px;
  margin-right: -15px;
  >div{
    padding: 0 15px;
  }
  .slimScrollBar {
    padding: 0;
    background-color: @brand-primary !important;
  }
}

/*
  修复闪屏问题
*/

.off-canvas-wrapper {
  display: none;
}

/*
  Select2
*/

.select2-container{
  width: 100% !important;
  .select2-selection--multiple{
    min-height: auto;
  }
}

.select2-container--default{
  &.select2-container--focus{
    .select2-selection--multiple{
      border-color: #40b6ff;
      outline: 0;
      box-shadow: inset 0 1px 3px rgba(0, 0, 0, .05), 0 0 8px #40b6ff;
      background-color: #fff;

    }
  }
  .select2-results__option{
    &[aria-selected=true] {
      display: none;
      >ul{
        display: none;
      }
      >li{
        display: none;
      }
    }
  }
}

.select2-results{
  padding: 0;
  max-height: 460px;
  .select2-disabled {
    background: transparent;
  }
  li{
    &.select2-result-with-children{
      &.select2-disabled{
        >.select2-result-label{
          color: #b7b7b7;
          cursor: default;
        }
      }
    }
  }
}


/*
  Ajax progress
  -- HTML --
  <div class="ajax-progress ajax-progress-throbber">
    <div class="throbber">&nbsp;</div>
  </div>
  -- BASE ICON --
  'core/themes/stable/images/core/throbber-active.gif'
*/
.ajax-progress-throbber {
  padding-bottom: 0;
}

.ajax-progress-throbber .throbber {
  padding-right: 9px;
  padding-bottom: 0;
  background: transparent no-repeat 0px center;
}